package cn.hansfly.properties;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

public class JavaProperties {
	public static void main(String[] args) {
		Properties prop = new Properties();
		try {
			prop.load(new FileInputStream("cn/hansfly/properties/test.prop"));
			prop.put("NO", "good123");
			prop.store(new FileOutputStream("cn/hansfly/properties/test.prop"), "all are here");
			System.out.println(prop.getProperty("LANG"));
			System.out.println(prop.getProperty("NAME"));
			
			prop.list(System.out);
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
